package com.gec.zhs.controller;

import java.util.List;

import com.gec.zhs.entity.query.FlowinstancetransitionhistoryQuery;
import com.gec.zhs.entity.po.Flowinstancetransitionhistory;
import com.gec.zhs.entity.vo.ResponseVO;
import com.gec.zhs.service.FlowinstancetransitionhistoryService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 工作流实例流转历史记录 Controller
 */
@RestController("flowinstancetransitionhistoryController")
@RequestMapping("/flowinstancetransitionhistory")
public class FlowinstancetransitionhistoryController extends ABaseController{

	@Resource
	private FlowinstancetransitionhistoryService flowinstancetransitionhistoryService;
	/**
	 * 根据条件分页查询
	 */
	@RequestMapping("/loadDataList")
	public ResponseVO loadDataList(FlowinstancetransitionhistoryQuery query){
		return getSuccessResponseVO(flowinstancetransitionhistoryService.findListByPage(query));
	}

	/**
	 * 新增
	 */
	@RequestMapping("/add")
	public ResponseVO add(Flowinstancetransitionhistory bean) {
		flowinstancetransitionhistoryService.add(bean);
		return getSuccessResponseVO(null);
	}

	/**
	 * 批量新增
	 */
	@RequestMapping("/addBatch")
	public ResponseVO addBatch(@RequestBody List<Flowinstancetransitionhistory> listBean) {
		flowinstancetransitionhistoryService.addBatch(listBean);
		return getSuccessResponseVO(null);
	}

	/**
	 * 批量新增/修改
	 */
	@RequestMapping("/addOrUpdateBatch")
	public ResponseVO addOrUpdateBatch(@RequestBody List<Flowinstancetransitionhistory> listBean) {
		flowinstancetransitionhistoryService.addBatch(listBean);
		return getSuccessResponseVO(null);
	}

	/**
	 * 根据Id查询对象
	 */
	@RequestMapping("/getFlowinstancetransitionhistoryById")
	public ResponseVO getFlowinstancetransitionhistoryById(String id) {
		return getSuccessResponseVO(flowinstancetransitionhistoryService.getFlowinstancetransitionhistoryById(id));
	}

	/**
	 * 根据Id修改对象
	 */
	@RequestMapping("/updateFlowinstancetransitionhistoryById")
	public ResponseVO updateFlowinstancetransitionhistoryById(Flowinstancetransitionhistory bean,String id) {
		flowinstancetransitionhistoryService.updateFlowinstancetransitionhistoryById(bean,id);
		return getSuccessResponseVO(null);
	}

	/**
	 * 根据Id删除
	 */
	@RequestMapping("/deleteFlowinstancetransitionhistoryById")
	public ResponseVO deleteFlowinstancetransitionhistoryById(String id) {
		flowinstancetransitionhistoryService.deleteFlowinstancetransitionhistoryById(id);
		return getSuccessResponseVO(null);
	}
}